//
//  YbrMusicPlayUtil.h
//  wifibox
//
//  Created by os X 10.9 on 14-12-17.
//  Copyright (c) 2014年 yinbaner. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YbrMusicItem.h"
#import "YbrPlayer.h"



//播放器播放时间代理
@protocol YbrMusicPlayUtilDelegate <NSObject>

@optional

- (void)playCallBack:(int) currTime totalTime:(int) totalTime;  // 返回的是正在播放的进度问题

@end



@interface YbrMusicPlayUtil : NSObject


@property (nonatomic ,weak) id<YbrMusicPlayUtilDelegate> delegate;

// Arr : YbrMusicItem对象
//+(void) playAll:(NSArray *) musiclist;
+(void)     playAll:(NSArray *) musiclist position:(int) position;  // 添加了一个播放哪一个

// 当进行dlna播放的时候进行这个播放(可让其支持后台播放)
+(void)     playOnDlna;
+(void)     PsuhPlayUrl:(NSString *) url;
+(BOOL)     isAlike:(NSArray *) musiclist;

// 返回Arr : YbrMusicItem 正在播放的Item
+(YbrMusicItem *)   getQueueItem;
+(BOOL)             isDlnaState;                // 是否在dlna状态

+(NSString *)   getArtistName;
+(NSString *)   getSingerName;
+(NSString *)   getMusicName;
+(int)          getDuration;
+(int)          getPoisiton;
+(void)         setQueuePosition:(int) index;
+(NSString *)   getBitmap;
+(BOOL)         isPlaying;
+(int)          getQueuePosition;

// 正在播放的音频的ID
+(int)          getAudioId;

// 播放状态操作
+(void)         Next;
+(void)         Prev;
+(void)         PlayOrPause;
+(void) Play;
+(void)         Stop;
+(void)         StopDlnaGetInfo;
+(void)         startDlnaGetInfo;

+(void)         seek:(NSTimeInterval) pos;
+(float)        getDlnaVolum;                   // 获得dlna的音量
+(void)         setDlnaVolum:(float) value;     // 设置Dlna的音量
+(BOOL)         isHaveMusic;
+(BOOL)         getIsTime;
+(NSString *)   getPlayTimeID;

// arr[0] 里面保存的是MusicItem Arr  arr[1] 表示播放第几个
+(NSArray *) getPlayArrAndRemLocal:(NSArray *) arr currPos:(int) currPos;

+(int)              whichPositionAtMusicItem:(NSArray *)musicItemArr musicId:(int) musicId;
+(int)              whichPositionAtMusicItemByName:(NSArray *)musicItemArr musicId:(NSString *) musicName;
+(int)              whichPositionAtClassInfo:(NSArray *)classInfoArr musicId:(int) musicId;
+(int)              whichPositionAtClassInfo:(NSArray *)classInfoArr musicName:(NSString *)musicName;
+(NSIndexPath *)    whichPositionAtTextClassInfo:(NSArray *)classInfoArr musicId:(int) musicId;
+(int)              whichPositionAtDownItem:(NSArray *)downItemArr musicId:(int) musicId;
+(int)              whichPositionAtMusicHall:(NSArray *) cellArr musicId:(int) musicid;

// 设置播放状态
+(void)             setPlayState;


@end






